package com.heima.wemedia.client;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmUserService;
import com.hema.feign.apis.Wemedia.IWemediaClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/wemedia/user")
public class WmUserController implements IWemediaClient {

    @Autowired
    private WmUserService wmUserService;

    @PostMapping("/add")
    public ResponseResult add(@RequestBody Map<String,String> map){
        String name = map.get("name");
        return wmUserService.add(name);
    }



}
